package com.example.springpeizhi.Controller;

import com.example.springpeizhi.model.DBtype;
import com.example.springpeizhi.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class YmlController {
    @Value("${string.value}")
    private String str;

    @RequestMapping("/yml")
    public String getYml(){
        return "获取yml配置"+str;
    }

    @Value("${String.str1}")
    private String s1;
    @Value("${String.str2}")
    private String s2;
    @Value("${String.str3}")
    private String s3;

    @RequestMapping("/yml2")
    public String getS(){
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(s3);
        return "获取配置文件String成功！！！";
    }

    @Autowired
    private Student student;
    @RequestMapping("/yml3")
    public String getY(){
        return student.toString();
    }

    @Autowired
    private DBtype dBtype;
    @RequestMapping("/yml4")
    public String getDB(){
        return dBtype.toString();
    }
}
